package org.njyinghuo.sdk.bytedance.client.douyin;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import org.njyinghuo.sdk.bytedance.conf.Config;

/**
 * @description:
 * @author: Hupengpeng
 * @time: 2021/7/5 9:12
 */
public class VideoUploadPartComplete {
    private String open_id;
    private String access_token;
    private String upload_id;
    private String response;

    private VideoUploadPartComplete() {
    }

    protected static VideoUploadPartComplete New() {
        return new VideoUploadPartComplete();
    }

    public VideoUploadPartComplete execute() {
        String url = StrUtil.format("{}{}?open_id={}&access_token={}&upload_id={}",
                Config.API_HTTP_SCHEME + Config.API_HOST,
                Config.API_VIDEO_UPLOAD_PART_COMPLETE,
                getOpen_id(),
                getAccess_token(),
                getUpload_id());
        String rs = HttpUtil.post(url, "");
        response = rs;
        return this;
    }

    public String getOpen_id() {
        return open_id;
    }

    public VideoUploadPartComplete setOpen_id(String open_id) {
        this.open_id = open_id;
        return this;
    }

    public String getAccess_token() {
        return access_token;
    }

    public VideoUploadPartComplete setAccess_token(String access_token) {
        this.access_token = access_token;
        return this;
    }

    public String getUpload_id() {
        return upload_id;
    }

    public VideoUploadPartComplete setUpload_id(String upload_id) {
        this.upload_id = upload_id;
        return this;
    }

    public String getResponse() {
        return response;
    }

    public VideoUploadPartComplete setResponse(String response) {
        this.response = response;
        return this;
    }
}
